package com.yanmaohu.yulia.bean;

import java.util.List;

/**
 * @author Bright Lee
 */
public final class TableValueConstructor implements SimpleTable {

    private int beginIndex;
    private int endIndex;
    private List<TableRowValueExpression> rowValueExpressionList;

    public TableValueConstructor(int beginIndex,
                                 List<TableRowValueExpression> rowValueExpressionList) {
        this.beginIndex = beginIndex;
        this.endIndex = rowValueExpressionList.get(rowValueExpressionList.size() - 1).getEndIndex();
        this.rowValueExpressionList = rowValueExpressionList;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public int size() {
        return rowValueExpressionList.size();
    }

    public TableRowValueExpression get(int index) {
        return rowValueExpressionList.get(index);
    }

}
